<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/moment.js/2.29.4/moment.js"></script>
</head>
<body>
    <script>
        // 格式化时间
        var time = moment().format('YYYY-MM-DD HH:mm:ss');
        var time2 = moment().format('YYYY年MM月DD日 HH-mm-ss');
        console.log(time,time2);
    </script>
</body>
</html>